<template>
  <div class="hello_world">
    <button class="top" @click="toTop">^</button>
  </div>
</template>

<script>
export default {
  methods: {
    toTop() {
      document.documentElement.scrollTop = 0;
    },
  },
};
</script>

<style>
.hello_world {
  height: 5000px;
}
.top {
    position: fixed;
    width: 30px;
    height: 30px;
    bottom: 50px;
    right: 100px;
    background-color: aqua;
  }
</style>
